from flask_restful import request


def get_datas():
    headers = request.headers
    print('headers:', headers)
    content_type = headers.get('Content-Type')
    if content_type == 'application/x-www-form-urlencoded':
        print('x-www-form-urlencoded:', request.form)
        return request.form
    if content_type == 'application/json':
        print('json:', request.get_json())
        return request.get_json()
    content_type_list = str(content_type).split(';')
    if len(content_type_list) > 0:
        if content_type_list[0] == 'multipart/form-data':
            print('multipart/form-data:', request.form)
            return request.form
        if content_type_list[0] == 'application/json':
            print('multipart/form-data:', request.form)
            return request.get_json()
